package io.renren.modules.canteens.dao;

import io.renren.common.dao.BaseDao;
import io.renren.modules.canteens.dto.BatchOrdermxDTO;
import io.renren.modules.canteens.entity.BatchOrdermxEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 批量采购明细表 
 *
* @author 翟文闯 619556390@QQ.com
 * @since 1.0.0 2020-01-03
 */
@Mapper
public interface BatchOrdermxDao extends BaseDao<BatchOrdermxEntity> {
    @Select("SELECT SUM(unit_price*purchase_num) as totalMoney  FROM canteens_batch_ordermx  where batch_order_id = '${batchOrderId}' ")
    BatchOrdermxDTO getTotalMoney(Long batchOrderId);

    @Select("delete from canteens_batch_ordermx where batch_ordermx_id = '${batchOrdermxId}' ")
    void delete1(Long batchOrdermxId);
}